<?
/*----------------------------------------------------------------------
          (C) Bobtail-Bear 2006 	小飞熊新一代下载系统
          	代码编写：小飞熊	版权所有：小飞熊[L.F.Bear]
				官方网站/技术支持：http://www.lfbear.cn
------------------------------------------------------------------------
          (C) Bobtail-Bear 2006 	L.F.Bear's New Download Sysytem
          	Powered by L.F.Bear  Copyright L.F.Bear's Home(R)
               Official Web/Support：http://www.lfbear.cn
-----------------------------------------------------------------------*/

//本页脚本功能：会员注册页面

$thispage="reg.php";
require("header.php"); 
$step=$_GET[step];
if($step=="") $step=1;
if($_SESSION[f_login]=="yes" || $_COOKIE[l_state]=="ok") $step=9;

if($users=="n" || $openreg=="n")
{
print <<<EOT
<body>
<table width="780" border="0" align="center" cellspacing="0">
    <td align="center" valign="top" class="tableHeader1"><br>
      <table width="580" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="32"><img src="$imagepath/h_priont_01.gif" width="32" height="25" /></td>
          <td width="58" align="left" background="$imagepath/header_mid.gif">$p_lang[177]</td>
          <td width="465" align="left" background="$imagepath/header_mid.gif">$p_lang[178]</td>
          <td width="25" background="$imagepath/header_mid.gif"><img src="$imagepath/h_priont_03.gif" width="25" height="25" /></td>
        </tr>
        <tr>
          <td height="250" colspan="4" align="center" bgcolor="#FFFFFF"><div align="center" class="markedText4">$p_lang[179]</div></td>
        </tr>
        <tr>
          <td height="25" colspan="4" bgcolor="#EFEBEF">&nbsp;</td>
        </tr>
      </table></td>
      </tr>
</table>
</body>
</html>
EOT;
die(require("footer.php"));
}
switch($step)
{
case 1:
print <<<EOT
<body>
<table width="780" border="0" align="center" cellspacing="0">
    <td align="center" valign="top" class="tableHeader1"><br>
      <table width="580" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="32"><img src="$imagepath/h_priont_01.gif" width="32" height="25" /></td>
          <td width="80" align="left" background="$imagepath/header_mid.gif">$p_lang[180]</td>
          <td width="443" align="left" background="$imagepath/header_mid.gif">$p_lang[181]</td>
          <td width="25" background="$imagepath/header_mid.gif"><img src="$imagepath/h_priont_03.gif" width="25" height="25" /></td>
        </tr>
        <tr>
          <td height="250" colspan="4" align="center"><textarea name="textarea" cols="70" rows="12" readonly="readonly">$agreement</textarea></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td height="25" colspan="2" align="center" background="$imagepath/header_mid.gif"><span class="markedText4">$p_lang[182]</span></td>
          <td height="25" align="left">&nbsp;</td>
        </tr>
        <tr>
          <td height="35" colspan="4" align="center" class="markedText4"><input type="button" name="Submit" value="$p_lang[183]" class="Button2" onClick="gotourl('reg.php?step=2')">
            &nbsp;
          <input type="button" name="Submit" value="$p_lang[184]" class="Button3" onClick="gotourl('index.php')"></td>
        </tr>
      </table></td>
      </tr>
</table>
</body>
</html>
EOT;

break;

case 2:

@require("include/config.base.php");
if($ccode=="y") $ccodeshow="<tr><td height='25' bgcolor='#EFEBEF' class='boldText'> $p_lang[185]</td><td align='left' bgcolor='#EFEBEF'><img src='$imagepath/itme0.gif' width='14' height='14'> <input name='code' type='text' size='10' title='$p_lang[186]' >&nbsp;<iframe id='codeshow' name='codeshow' marginheight=0 marginwidth=0 scrolling=no src='code.php' height='20' width='45'></iframe>&nbsp;<a href='code.php' target='codeshow' title='$p_lang[187]'><font color='#FF3300'>$p_lang[188]</font></a></td></tr>";

print <<<EOT
<body>
<table width="780" border="0" align="center" cellspacing="0">
    <td align="center" valign="top" class="tableHeader1"><br>
      <table width="580" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="32"><img src="$imagepath/h_priont_01.gif" width="32" height="25" /></td>
          <td width="58" align="left" background="$imagepath/header_mid.gif">$p_lang[189]</td>
          <td width="465" align="left" background="$imagepath/header_mid.gif">$p_lang[190]</td>
          <td width="25" background="$imagepath/header_mid.gif"><img src="$imagepath/h_priont_03.gif" width="25" height="25" /></td>
        </tr>
        <tr>
          <td height="180" colspan="4" align="center"><form  method="post" action="reg.php?step=check">
            <table width="401" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="100" height="25" bgcolor="#EFEBEF"><span class="boldText">$p_lang[191]</span></td>
                <td align="left" bgcolor="#EFEBEF"><span class="boldText"><img src="$imagepath/itme0.gif"  width="14" height="14"></span>
                  <input name="name" type="text" size="30" title="$p_lang[192]"></td>
              </tr>
              <tr>
                <td height="25" bgcolor="#EFEBEF" class="boldText">$p_lang[194]</td>
                <td align="left" bgcolor="#EFEBEF"><img src="$imagepath/itme0.gif" width="14" height="14">
                  <input name="pass1" type="password" size="30"  title="$p_lang[195]"></td>
              </tr>
              <tr>
                <td height="25" bgcolor="#EFEBEF" class="boldText">$p_lang[196]</td>
                <td align="left" bgcolor="#EFEBEF"><img src="$imagepath/itme0.gif" width="14" height="14">
                  <input name="pass2" type="password" size="30"  title="$p_lang[195]"></td>
              </tr>
              <tr>
                <td height="25" bgcolor="#EFEBEF" class="boldText">$p_lang[193]</td>
                <td align="left" bgcolor="#EFEBEF"><img src="$imagepath/itme0.gif" width="14" height="14">
                  <input name="email" type="text" size="30" value="$p_lang[197]"  title="$p_lang[198]" ></td>
              </tr>
              $ccodeshow
              <tr>
                <td height="40" colspan="2" align="center" bgcolor="#EFEBEF"><input type="submit" name="Submit" value="$common[submit]" class="Button2">
                  &nbsp;&nbsp;
                  <input type="reset" name="Submit2" value="$common[reset]" class="Button3"></td>
              </tr>
            </table>
                    </form>
          </td>
        </tr>
        <tr>
          <td height="25" colspan="4" align="center" background="$imagepath/header_mid.gif" bgcolor="#EFEBEF" class="markedText4">$p_lang[199]</td>
        </tr>
      </table></td>
      </tr>
</table>
</body>
</html>
EOT;
break;

case 9:

print <<<EOT
<body>
<table width="780" border="0" align="center" cellspacing="0">
    <td align="center" valign="top" class="tableHeader1"><br>
      <table width="580" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="32"><img src="$imagepath/h_priont_01.gif" width="32" height="25" /></td>
          <td width="58" align="left" background="$imagepath/header_mid.gif">$p_lang[177]</td>
          <td width="465" align="left" background="$imagepath/header_mid.gif">$p_lang[178]</td>
          <td width="25" background="$imagepath/header_mid.gif"><img src="$imagepath/h_priont_03.gif" width="25" height="25" /></td>
        </tr>
        <tr>
          <td height="250" colspan="4" align="center" bgcolor="#FFFFFF"><div align="center" class="markedText4">$p_lang[200]</div></td>
        </tr>
        <tr>
          <td height="25" colspan="4" bgcolor="#EFEBEF">&nbsp;</td>
        </tr>
      </table></td>
      </tr>
</table>
</body>
</html>
EOT;
break;

case check:
//取得数据
$name=$_POST[name];
$pass1=$_POST[pass1];
$pass2=$_POST[pass2];
$email=$_POST[email];
$code=$_POST[code];
//开始各种验证，哈哈
@require("include/config.base.php");
if($ccode=="y" && md5(md5($code))!=$_SESSION[code])
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[201];
$fb_msg=$p_lang[202];
require("feedback.php");
}
if($name=="")
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[201];
$fb_msg=$p_lang[203];
require("feedback.php");
}
if(strlen($pass1)<6)
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[201];
$fb_msg=$p_lang[204];
require("feedback.php");
}
if($pass1!=$pass2){
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[201];
$fb_msg=$p_lang[205];
require("feedback.php");
}
if(!eregi('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$',$email))
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[201];
$fb_msg=$p_lang[206];
require("feedback.php");
}
if(file_exists($path_user."/".$name.".php"))

{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[201];
$fb_msg=$p_lang[207];
require("feedback.php");
}
//验证结束了，不容易啊。开始写入数据
$pass=md5($pass1);
$die="<? die;?>";
$sep="|";
$info=$die.$sep.$name.$sep.$pass.$sep."2".$sep.$first_point.$sep.$first_down;
$user_num=readf($path_user."/"."number");
$user_num++;
writef($path_user."/"."number",$user_num,"w");
writef($path_user."/".$name.".php",$info,"w");
$info2=$die.$sep.$email;
writef($path_user."/".$name.".dat",$info2,"w");
{
$fb_title1=$t_lang[71];
$fb_title2=$t_lang[210];
$fb_msg="$t_lang[208] $name [ ID:$user_num ] $t_lang[209]";
$fb_link="index.php";
require("feedback.php");
}
break;

default:
$fb_title1=$t_lang[116];
$fb_title2=$t_lang[134];
$fb_msg=$t_lang[135];
require("feedback.php");
break;
}
require("footer.php");
?>